/// <summary>
// CodeFx.MySqlProviders - .NET Providers for MySql using the framework CodeFx
// Laurent Morisseau
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Laurent Morisseau
/// </summary>
/// <author><a href="mailto:laurent.morisseau@gmail.com">Laurent Morisseau</a></author>

namespace CodeFx.MySqlProviders
{
	using System;
	using System.Text ;
	using System.Web;
	using System.Data;
    using CodeFx.Web;
    using MySql.Data.MySqlClient;

	public partial class Aspnet_membershipDAL: DALBase
	{
		/// <summary>
		/// Enumeration de tous les champs de aspnet_membership
		/// <summary>
		public enum Fields 
		{ 
			#region Enumeration de tous les champs de aspnet_membership
ApplicationId,
UserId,
Password,
PasswordFormat,
PasswordSalt,
MobilePin,
Email,
PasswordQuestion,
PasswordAnswer,
IsApproved,
IsLockedOut,
CreateDate,
LastLoginDate,
LastPasswordChangedDate,
LastLockedOutDate,
FailedPasswordAttemptCount,
FailedPasswordAttemptWindowStart,
FailedPasswordAnswerAttemptCount,
FailedPasswordAnswerAttemptWindowStart,
Comment
			#endregion
		}
	
		#region Private Properties aspnet_membership
		/// <summary>
		/// Champ ApplicationId de la table aspnet_membership
		/// </summary>
		/// <remarks>Membre Non Nullable. Membre d'une cle etrangere. </remarks>
		private uint _ApplicationId;

		/// <summary>
		/// Champ UserId de la table aspnet_membership
		/// </summary>
		/// <remarks>Membre de la cle primaire. Membre d'une cle etrangere. </remarks>
		private uint _UserId;

		/// <summary>
		/// Champ Password de la table aspnet_membership
		/// </summary>
		/// <remarks>Membre Non Nullable. </remarks>
		private string _Password = String.Empty;

		/// <summary>
		/// Champ PasswordFormat de la table aspnet_membership
		/// </summary>
		/// <remarks>Membre Non Nullable. </remarks>
		private byte _PasswordFormat;

		/// <summary>
		/// Champ PasswordSalt de la table aspnet_membership
		/// </summary>
		/// <remarks>Membre Non Nullable. </remarks>
		private string _PasswordSalt = String.Empty;

		/// <summary>
		/// Champ MobilePin de la table aspnet_membership
		/// </summary>
		private string _MobilePin = String.Empty;

		/// <summary>
		/// Champ Email de la table aspnet_membership
		/// </summary>
		private string _Email = String.Empty;

		/// <summary>
		/// Champ PasswordQuestion de la table aspnet_membership
		/// </summary>
		private string _PasswordQuestion = String.Empty;

		/// <summary>
		/// Champ PasswordAnswer de la table aspnet_membership
		/// </summary>
		private string _PasswordAnswer = String.Empty;

		/// <summary>
		/// Champ IsApproved de la table aspnet_membership
		/// </summary>
		private byte _IsApproved;

		/// <summary>
		/// Champ IsLockedOut de la table aspnet_membership
		/// </summary>
		private byte _IsLockedOut;

		/// <summary>
		/// Champ CreateDate de la table aspnet_membership
		/// </summary>
		private DateTime _CreateDate;

		/// <summary>
		/// Champ LastLoginDate de la table aspnet_membership
		/// </summary>
		private DateTime _LastLoginDate;

		/// <summary>
		/// Champ LastPasswordChangedDate de la table aspnet_membership
		/// </summary>
		private DateTime _LastPasswordChangedDate;

		/// <summary>
		/// Champ LastLockedOutDate de la table aspnet_membership
		/// </summary>
		private DateTime _LastLockedOutDate;

		/// <summary>
		/// Champ FailedPasswordAttemptCount de la table aspnet_membership
		/// </summary>
		private uint _FailedPasswordAttemptCount;

		/// <summary>
		/// Champ FailedPasswordAttemptWindowStart de la table aspnet_membership
		/// </summary>
		private DateTime _FailedPasswordAttemptWindowStart;

		/// <summary>
		/// Champ FailedPasswordAnswerAttemptCount de la table aspnet_membership
		/// </summary>
		private uint _FailedPasswordAnswerAttemptCount;

		/// <summary>
		/// Champ FailedPasswordAnswerAttemptWindowStart de la table aspnet_membership
		/// </summary>
		private DateTime _FailedPasswordAnswerAttemptWindowStart;

		/// <summary>
		/// Champ Comment de la table aspnet_membership
		/// </summary>
		private string _Comment = String.Empty;

		#endregion
		
		#region Public Properties
		
		public uint ApplicationId
		{
			get {return this._ApplicationId;}
			set {
					if ( this._ApplicationId != value)
					{
						this.IsTouched = (this._ApplicationId != value);
						this._ApplicationId = value;
					}
				}
		}

		public uint UserId
		{
			get {return this._UserId;}
			set {
					if ( this._UserId != value)
					{
						this.IsTouched = (this._UserId != value);
						this._UserId = value;
					}
				}
		}

		public string Password
		{
			get {return this._Password;}
			set {
					if ( this._Password != value)
					{
						this.IsTouched = (this._Password != value);
						this._Password = value;
					}
				}
		}

		public byte PasswordFormat
		{
			get {return this._PasswordFormat;}
			set {
					if ( this._PasswordFormat != value)
					{
						this.IsTouched = (this._PasswordFormat != value);
						this._PasswordFormat = value;
					}
				}
		}

		public string PasswordSalt
		{
			get {return this._PasswordSalt;}
			set {
					if ( this._PasswordSalt != value)
					{
						this.IsTouched = (this._PasswordSalt != value);
						this._PasswordSalt = value;
					}
				}
		}

		public string MobilePin
		{
			get {return this._MobilePin;}
			set {
					if ( this._MobilePin != value)
					{
						this.IsTouched = (this._MobilePin != value);
						this._MobilePin = value;
					}
				}
		}

		public string Email
		{
			get {return this._Email;}
			set {
					if ( this._Email != value)
					{
						this.IsTouched = (this._Email != value);
						this._Email = value;
					}
				}
		}

		public string PasswordQuestion
		{
			get {return this._PasswordQuestion;}
			set {
					if ( this._PasswordQuestion != value)
					{
						this.IsTouched = (this._PasswordQuestion != value);
						this._PasswordQuestion = value;
					}
				}
		}

		public string PasswordAnswer
		{
			get {return this._PasswordAnswer;}
			set {
					if ( this._PasswordAnswer != value)
					{
						this.IsTouched = (this._PasswordAnswer != value);
						this._PasswordAnswer = value;
					}
				}
		}

		public byte IsApproved
		{
			get {return this._IsApproved;}
			set {
					if ( this._IsApproved != value)
					{
						this.IsTouched = (this._IsApproved != value);
						this._IsApproved = value;
					}
				}
		}

		public byte IsLockedOut
		{
			get {return this._IsLockedOut;}
			set {
					if ( this._IsLockedOut != value)
					{
						this.IsTouched = (this._IsLockedOut != value);
						this._IsLockedOut = value;
					}
				}
		}

		public DateTime CreateDate
		{
			get {return this._CreateDate;}
			set {
					if ( this._CreateDate != value)
					{
						this.IsTouched = (this._CreateDate != value);
						this._CreateDate = value;
					}
				}
		}

		public DateTime LastLoginDate
		{
			get {return this._LastLoginDate;}
			set {
					if ( this._LastLoginDate != value)
					{
						this.IsTouched = (this._LastLoginDate != value);
						this._LastLoginDate = value;
					}
				}
		}

		public DateTime LastPasswordChangedDate
		{
			get {return this._LastPasswordChangedDate;}
			set {
					if ( this._LastPasswordChangedDate != value)
					{
						this.IsTouched = (this._LastPasswordChangedDate != value);
						this._LastPasswordChangedDate = value;
					}
				}
		}

		public DateTime LastLockedOutDate
		{
			get {return this._LastLockedOutDate;}
			set {
					if ( this._LastLockedOutDate != value)
					{
						this.IsTouched = (this._LastLockedOutDate != value);
						this._LastLockedOutDate = value;
					}
				}
		}

		public uint FailedPasswordAttemptCount
		{
			get {return this._FailedPasswordAttemptCount;}
			set {
					if ( this._FailedPasswordAttemptCount != value)
					{
						this.IsTouched = (this._FailedPasswordAttemptCount != value);
						this._FailedPasswordAttemptCount = value;
					}
				}
		}

		public DateTime FailedPasswordAttemptWindowStart
		{
			get {return this._FailedPasswordAttemptWindowStart;}
			set {
					if ( this._FailedPasswordAttemptWindowStart != value)
					{
						this.IsTouched = (this._FailedPasswordAttemptWindowStart != value);
						this._FailedPasswordAttemptWindowStart = value;
					}
				}
		}

		public uint FailedPasswordAnswerAttemptCount
		{
			get {return this._FailedPasswordAnswerAttemptCount;}
			set {
					if ( this._FailedPasswordAnswerAttemptCount != value)
					{
						this.IsTouched = (this._FailedPasswordAnswerAttemptCount != value);
						this._FailedPasswordAnswerAttemptCount = value;
					}
				}
		}

		public DateTime FailedPasswordAnswerAttemptWindowStart
		{
			get {return this._FailedPasswordAnswerAttemptWindowStart;}
			set {
					if ( this._FailedPasswordAnswerAttemptWindowStart != value)
					{
						this.IsTouched = (this._FailedPasswordAnswerAttemptWindowStart != value);
						this._FailedPasswordAnswerAttemptWindowStart = value;
					}
				}
		}

		public string Comment
		{
			get {return this._Comment;}
			set {
					if ( this._Comment != value)
					{
						this.IsTouched = (this._Comment != value);
						this._Comment = value;
					}
				}
		}
		
		public string Key
        {
			get
			{
        	   	return this._UserId.ToString();
        	}
		}
		#endregion
		
		#region Override Methods
		public void Clone(Aspnet_membershipDAL dataObject)
        {
            if (dataObject == null)
                throw new ArgumentNullException("dataObject");
            	this._ApplicationId = dataObject.ApplicationId;
            	this._Password = dataObject.Password;
            	this._PasswordFormat = dataObject.PasswordFormat;
            	this._PasswordSalt = dataObject.PasswordSalt;
            	this._MobilePin = dataObject.MobilePin;
            	this._Email = dataObject.Email;
            	this._PasswordQuestion = dataObject.PasswordQuestion;
            	this._PasswordAnswer = dataObject.PasswordAnswer;
            	this._IsApproved = dataObject.IsApproved;
            	this._IsLockedOut = dataObject.IsLockedOut;
            	this._CreateDate = dataObject.CreateDate;
            	this._LastLoginDate = dataObject.LastLoginDate;
            	this._LastPasswordChangedDate = dataObject.LastPasswordChangedDate;
            	this._LastLockedOutDate = dataObject.LastLockedOutDate;
            	this._FailedPasswordAttemptCount = dataObject.FailedPasswordAttemptCount;
            	this._FailedPasswordAttemptWindowStart = dataObject.FailedPasswordAttemptWindowStart;
            	this._FailedPasswordAnswerAttemptCount = dataObject.FailedPasswordAnswerAttemptCount;
            	this._FailedPasswordAnswerAttemptWindowStart = dataObject.FailedPasswordAnswerAttemptWindowStart;
            	this._Comment = dataObject.Comment;
        }
		
       	public override sealed string ToString()
        {
            StringBuilder Text = new StringBuilder( this.GetType().FullName );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "ApplicationId", this.ApplicationId, "FK " );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "UserId", this.UserId, "PK FK " );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "Password", this.Password, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PasswordFormat", this.PasswordFormat, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PasswordSalt", this.PasswordSalt, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "MobilePin", this.MobilePin, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "Email", this.Email, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PasswordQuestion", this.PasswordQuestion, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "PasswordAnswer", this.PasswordAnswer, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "IsApproved", this.IsApproved, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "IsLockedOut", this.IsLockedOut, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "CreateDate", this.CreateDate, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "LastLoginDate", this.LastLoginDate, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "LastPasswordChangedDate", this.LastPasswordChangedDate, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "LastLockedOutDate", this.LastLockedOutDate, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "FailedPasswordAttemptCount", this.FailedPasswordAttemptCount, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "FailedPasswordAttemptWindowStart", this.FailedPasswordAttemptWindowStart, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "FailedPasswordAnswerAttemptCount", this.FailedPasswordAnswerAttemptCount, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "FailedPasswordAnswerAttemptWindowStart", this.FailedPasswordAnswerAttemptWindowStart, "" );
			Text.AppendFormat( "\r\n \t{0} {2}: {1}", "Comment", this.Comment, "" );
			return Text.ToString();
        }
		
		public override sealed void Read(IDataReader reader)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");
            base.Read(reader);
			MySqlDataReader myreader = (MySqlDataReader)reader;
this._ApplicationId= myreader.GetUInt32((int)Aspnet_membershipDAL.Fields.ApplicationId);
this._UserId= myreader.GetUInt32((int)Aspnet_membershipDAL.Fields.UserId);
this._Password= myreader.GetString((int)Aspnet_membershipDAL.Fields.Password);
this._PasswordFormat= myreader.GetByte((int)Aspnet_membershipDAL.Fields.PasswordFormat);
this._PasswordSalt= myreader.GetString((int)Aspnet_membershipDAL.Fields.PasswordSalt);
this._MobilePin= myreader.GetString((int)Aspnet_membershipDAL.Fields.MobilePin);
this._Email= myreader.GetString((int)Aspnet_membershipDAL.Fields.Email);
this._PasswordQuestion= myreader.GetString((int)Aspnet_membershipDAL.Fields.PasswordQuestion);
this._PasswordAnswer= myreader.GetString((int)Aspnet_membershipDAL.Fields.PasswordAnswer);
this._IsApproved= myreader.GetByte((int)Aspnet_membershipDAL.Fields.IsApproved);
this._IsLockedOut= myreader.GetByte((int)Aspnet_membershipDAL.Fields.IsLockedOut);
this._CreateDate= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.CreateDate);
this._LastLoginDate= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.LastLoginDate);
this._LastPasswordChangedDate= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.LastPasswordChangedDate);
this._LastLockedOutDate= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.LastLockedOutDate);
this._FailedPasswordAttemptCount= myreader.GetUInt32((int)Aspnet_membershipDAL.Fields.FailedPasswordAttemptCount);
this._FailedPasswordAttemptWindowStart= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.FailedPasswordAttemptWindowStart);
this._FailedPasswordAnswerAttemptCount= myreader.GetUInt32((int)Aspnet_membershipDAL.Fields.FailedPasswordAnswerAttemptCount);
this._FailedPasswordAnswerAttemptWindowStart= myreader.GetDateTime((int)Aspnet_membershipDAL.Fields.FailedPasswordAnswerAttemptWindowStart);
this._Comment= myreader.GetString((int)Aspnet_membershipDAL.Fields.Comment);
        }

        public override sealed void Write(IDbCommand cmd)
        {
			if (cmd == null)
                throw new ArgumentNullException("cmd");
            base.Write(cmd);
cmd.Parameters.Add(new MySqlParameter("?ApplicationId", this._ApplicationId));
cmd.Parameters.Add(new MySqlParameter("?UserId", this._UserId));
cmd.Parameters.Add(new MySqlParameter("?Password", this._Password));
cmd.Parameters.Add(new MySqlParameter("?PasswordFormat", this._PasswordFormat));
cmd.Parameters.Add(new MySqlParameter("?PasswordSalt", this._PasswordSalt));
cmd.Parameters.Add(new MySqlParameter("?MobilePin", this._MobilePin));
cmd.Parameters.Add(new MySqlParameter("?Email", this._Email));
cmd.Parameters.Add(new MySqlParameter("?PasswordQuestion", this._PasswordQuestion));
cmd.Parameters.Add(new MySqlParameter("?PasswordAnswer", this._PasswordAnswer));
cmd.Parameters.Add(new MySqlParameter("?IsApproved", this._IsApproved));
cmd.Parameters.Add(new MySqlParameter("?IsLockedOut", this._IsLockedOut));
cmd.Parameters.Add(new MySqlParameter("?CreateDate", this._CreateDate));
cmd.Parameters.Add(new MySqlParameter("?LastLoginDate", this._LastLoginDate));
cmd.Parameters.Add(new MySqlParameter("?LastPasswordChangedDate", this._LastPasswordChangedDate));
cmd.Parameters.Add(new MySqlParameter("?LastLockedOutDate", this._LastLockedOutDate));
cmd.Parameters.Add(new MySqlParameter("?FailedPasswordAttemptCount", this._FailedPasswordAttemptCount));
cmd.Parameters.Add(new MySqlParameter("?FailedPasswordAttemptWindowStart", this._FailedPasswordAttemptWindowStart));
cmd.Parameters.Add(new MySqlParameter("?FailedPasswordAnswerAttemptCount", this._FailedPasswordAnswerAttemptCount));
cmd.Parameters.Add(new MySqlParameter("?FailedPasswordAnswerAttemptWindowStart", this._FailedPasswordAnswerAttemptWindowStart));
cmd.Parameters.Add(new MySqlParameter("?Comment", this._Comment));
        }

		public override sealed void WriteId(IDbCommand cmd)
        {
            if (cmd == null)
                throw new ArgumentNullException("cmd");
            base.WriteId(cmd);
cmd.Parameters.Add(new MySqlParameter("?UserId", this._UserId));
        }
        #endregion
				
	}
}
